#ifndef __traceroute_h__
#define __traceroute_h__ 1

#define TR_MAX_HOP 35
#define TRACEROUTE_UDP_DEF_PORT 33845
enum {
    OPT_PRO_ICMP = 1,
    OPT_PRO_UDP,
    OPT_PRO_AUTO,
};
typedef struct {
    uint32_t ip;
    uint16_t port;
    uint16_t blocksize;
    int max_hop;
    int timeout;
    int opt;
} tr_arg_t;

typedef struct {
    uint32_t ip;
    float latency;
    int ttl;
} tr_ret_t;

typedef struct {
    int count;
    tr_ret_t ret[TR_MAX_HOP];
} tr_result_t;

void* do_traceroute(void* arg);
void tr_result_print(tr_result_t* result);
#endif